package com.glsc.ngateway.common.base.domain.oracle.ecology;

import com.glsc.ngateway.common.base.domain.convert.LocalDateAttributeConverter_10;
import com.glsc.ngateway.common.base.domain.convert.WorkflowRequestlog_LogType_Converter;
import com.glsc.ngateway.common.base.enums.OaFlowLogTypeEnum;
import com.glsc.ngateway.common.base.enums.OaOperatortypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalTime;

@ToString
@AllArgsConstructor
@NoArgsConstructor
@Data
@Entity
@Table(name = "WORKFLOW_REQUESTLOG", schema = "ECOLOGY_TARGET", catalog = "")
public class WorkflowRequestlog {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "LOGID")
    private Long LOGID;

    @Column(name = "requestid")
    private Long requestid;

    @Column(name = "workflowid")
    private Long workflowid;

    @Column(name = "nodeid")
    private Long nodeid;

    @Column(name = "logtype")
    @Convert(converter = WorkflowRequestlog_LogType_Converter.class)
    private OaFlowLogTypeEnum logtype;

    @Column(name = "operatedate")
    @Convert(converter = LocalDateAttributeConverter_10.class)
    private LocalDate operatedate;

    @Column(name = "operatetime")
    private LocalTime operatetime;

    @Column(name = "operator")
    private Long operator;

    @Column(name = "remark")
//    @Convert(converter = WorkflowRequestlog_remark_Converter.class)
    private String remark;

    @Column(name = "clientip")
    private String clientip;

    @Column(name = "operatortype")
    @Enumerated(EnumType.ORDINAL)
    private OaOperatortypeEnum operatortype;

    @Column(name = "destnodeid")
    private Long destnodeid;

    @Column(name = "receivedPersons")
    private String receivedPersons;

    @Column(name = "showorder")
    private Long showorder;

    @Column(name = "agentorbyagentid")
    private Long agentorbyagentid;

    @Column(name = "agenttype")
    private String agenttype;

    @Column(name = "annexdocids")
    private String annexdocids;

    @Column(name = "requestLogId")
    private Long requestLogId;

    @Column(name = "operatorDept")
    private Long operatorDept;

    @Column(name = "signdocids")
    private String signdocids;

    @Column(name = "signworkflowids")
    private String signworkflowids;

    @Column(name = "isMobile")
    private String isMobile;

    @Column(name = "HandWrittenSign")
    private String HandWrittenSign;

    @Column(name = "SpeechAttachment")
    private Long SpeechAttachment;

    @Column(name = "receivedpersonids")
    private String receivedpersonids;

    @Column(name = "remarklocation")
    private String remarkLocation;

    @Column(name = "issubmitdirect")
    private String isSubmitDirect;

    @OneToOne(fetch = FetchType.EAGER)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "operator", referencedColumnName = "id", insertable = false, updatable = false)
    private Hrmresource hrmresource;
}
